Who Debates, Who Wins?
Jeremy Bowles & Horacio Larreguy

Replication Readme

Software used: Stata/MP 18.0, R 4.4.0

Required packages (Stata): esttab, estout, reghdfe
Required packages (R): pacman, vdemdata, fixest, modelsummary, kableExtra, nprobust, dplyr, tidyr, ggplot2, wesanderson, haven, forcats, viridis, stringr, data.table

To replicate all figures and plots in the paper, run files in this order:

(1) make_tables.do			: Stata file which generates all tables (apart from Table 7) in the manuscript and supplementary materials and outputs to "Tables" subfolder.
					  This file will sequentially run the .do files in the "Code" subfolder for the various levels of analysis used throughout the paper. 
					  Note that both "make_tables_voter_candidate.do" and "make_tables_ps.do" must be run to fully compile Table 6.
(2) make_figures.R			: R file which generates all figures in the manuscript and supplementary materials and outputs to "Figures" subfolder.
					  This file also generates Table 7 ("Characterizing compliers").
(3) all_tables_and_figures.tex		: Shell LaTeX file which will populate with the outputs of (1) and (2). 
					  All tables and figures are named according to their respective positions in the paper.
  					  The "Tables" and "Figures" subfolders are populated with the output of the replication package to enable this file to render without running the replication scripts.
Other files in root folder:

Codebook.pdf			: Codebook for analysis datasets.
main_and_appendix.tex		: All tables and figures in main paper/online appendix produced using replication data.
main_and_appendix.pdf		: All tables and figures in main paper/online appendix produced using replication data (output).
refs.bib			: References cited in footnotes of Tables and Figures in main_and_appendix.tex.

Files in "Data" subfolder (see Codebook for information on particular variables):

Data/data_candidates.dta		: Survey data relating to survey of election candidates.Data/data_incumbents.dta		: Analysis data relating to performance of incumbents.Data/data_ps.dta			: Analysis data relating to polling station level electoral results.Data/data_voter_candidate.dta		: Survey data at the respondent-candidate level.Data/data_voter.dta 			: Survey data at the respondent level.
Data/question_correspondence.csv	: Correspondence file used to populate figure labels in make_figures.R.

Files in "Survey instruments" subfolder:

Survey instruments/voter_survey.pdf	: Voter survey instrument (see Appendix A.6.2 and A.6.3 for mapping of survey questions to outcome variables).
Survey instruments/candidate_survey.pdf	: Candidate survey instrument.

